home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  36.9 KB  |  1,130 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992, 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMAPPLICATION__
  19. #define __CMAPPLICATION__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30. #ifndef __PRINTING__
  31. #include <Printing.h>
  32. #endif
  33. #ifndef __CMICCPROFILE__
  34. #include <CMICCProfile.h>
  35. #endif
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59.  
  60. enum {
  61.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  62. };
  63.  
  64. /* Macintosh 68K trap word */
  65.  
  66. enum {
  67.     cmTrap                        = 0xABEE
  68. };
  69.  
  70.  
  71. /* PicComment IDs */
  72.  
  73. enum {
  74.     cmBeginProfile                = 220,
  75.     cmEndProfile                = 221,
  76.     cmEnableMatching            = 222,
  77.     cmDisableMatching            = 223,
  78.     cmComment                    = 224
  79. };
  80.  
  81. /* PicComment selectors for cmComment */
  82.  
  83. enum {
  84.     cmBeginProfileSel            = 0,
  85.     cmContinueProfileSel        = 1,
  86.     cmEndProfileSel                = 2,
  87.     cmProfileIdentifierSel        = 3
  88. };
  89.  
  90.  
  91. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  92.  
  93. enum {
  94.     cmMatchCMMType                = 0x00000001,
  95.     cmMatchApplProfileVersion    = 0x00000002,
  96.     cmMatchDataType                = 0x00000004,
  97.     cmMatchDeviceType            = 0x00000008,
  98.     cmMatchDeviceManufacturer    = 0x00000010,
  99.     cmMatchDeviceModel            = 0x00000020,
  100.     cmMatchDeviceAttributes        = 0x00000040,
  101.     cmMatchFlags                = 0x00000080,
  102.     cmMatchOptions                = 0x00000100,
  103.     cmMatchWhite                = 0x00000200,
  104.     cmMatchBlack                = 0x00000400
  105. };
  106.  
  107. /* Defines for version 2.0 CMSearchRecord.searchMask */
  108.  
  109. enum {
  110.     cmMatchAnyProfile            = 0x00000000,
  111.     cmMatchProfileCMMType        = 0x00000001,
  112.     cmMatchProfileClass            = 0x00000002,
  113.     cmMatchDataColorSpace        = 0x00000004,
  114.     cmMatchProfileConnectionSpace = 0x00000008,
  115.     cmMatchManufacturer            = 0x00000010,
  116.     cmMatchModel                = 0x00000020,
  117.     cmMatchAttributes            = 0x00000040,
  118.     cmMatchProfileFlags            = 0x00000080
  119. };
  120.  
  121. /* Result codes */
  122.  
  123. enum {
  124.                                                                 /* General Errors */
  125.     cmProfileError                = -170,
  126.     cmMethodError                = -171,
  127.     cmMethodNotFound            = -175,                            /* CMM not present */
  128.     cmProfileNotFound            = -176,                            /* Responder error */
  129.     cmProfilesIdentical            = -177,                            /* Profiles the same */
  130.     cmCantConcatenateError        = -178,                            /* Profile can't be concatenated */
  131.     cmCantXYZ                    = -179,                            /* CMM cant handle XYZ space */
  132.     cmCantDeleteProfile            = -180,                            /* Responder error */
  133.     cmUnsupportedDataType        = -181,                            /* Responder error */
  134.     cmNoCurrentProfile            = -182,                            /* Responder error */
  135.                                                                 /* Profile Access Errors */
  136.     cmElementTagNotFound        = -4200,
  137.     cmIndexRangeErr                = -4201,                        /* Tag index out of range */
  138.     cmCantDeleteElement            = -4202,
  139.     cmFatalProfileErr            = -4203,
  140.     cmInvalidProfile            = -4204,                        /* A Profile must contain a 'cs1 ' tag to be valid */
  141.     cmInvalidProfileLocation    = -4205,                        /* Operation not supported for this profile location */
  142.     cmCantCopyModifiedV1Profile    = -4215,                        /* Illegal to copy version 1 profiles that have been modified */
  143.                                                                 /* Profile Search Errors */
  144.     cmInvalidSearch                = -4206,                        /* Bad Search Handle */
  145.     cmSearchError                = -4207,
  146.     cmErrIncompatibleProfile    = -4208,                        /* Other ColorSync Errors */
  147.     cmInvalidColorSpace            = -4209,                        /* Profile colorspace does not match bitmap type */
  148.     cmInvalidSrcMap                = -4210,                        /* Source pix/bit map was invalid */
  149.     cmInvalidDstMap                = -4211,                        /* Destination pix/bit map was invalid */
  150.     cmNoGDevicesError            = -4212,                        /* Begin/End Matching -- no gdevices available */
  151.     cmInvalidProfileComment        = -4213,                        /* Bad Profile comment during drawpicture */
  152.     cmRangeOverFlow                = -4214,                        /* Color conversion warning that some output color values over/underflowed and were clipped */
  153.     cmNamedColorNotFound        = -4216,                        /* NamedColor not found */
  154.     cmCantGamutCheckError        = -4217                            /* Gammut checking not supported by this ColorWorld */
  155. };
  156.  
  157. /* deviceType values for ColorSync 1.0 Device Profile access */
  158.  
  159. enum {
  160.     cmSystemDevice                = FOUR_CHAR_CODE('sys '),
  161.     cmGDevice                    = FOUR_CHAR_CODE('gdev')
  162. };
  163.  
  164. /* Commands for CMFlattenUPP(…) */
  165.  
  166. enum {
  167.     cmOpenReadSpool                = 1,
  168.     cmOpenWriteSpool            = 2,
  169.     cmReadSpool                    = 3,
  170.     cmWriteSpool                = 4,
  171.     cmCloseSpool                = 5
  172. };
  173.  
  174. /* Flags for PostScript-related functions */
  175.  
  176. enum {
  177.     cmPS7bit                    = 1,
  178.     cmPS8bit                    = 2
  179. };
  180.  
  181. /* Flags for profile embedding functions */
  182.  
  183. enum {
  184.     cmEmbedWholeProfile            = 0x00000000,
  185.     cmEmbedProfileIdentifier    = 0x00000001
  186. };
  187.  
  188. /* Commands for CMAccessUPP(…) */
  189.  
  190. enum {
  191.     cmOpenReadAccess            = 1,
  192.     cmOpenWriteAccess            = 2,
  193.     cmReadAccess                = 3,
  194.     cmWriteAccess                = 4,
  195.     cmCloseAccess                = 5,
  196.     cmCreateNewAccess            = 6,
  197.     cmAbortWriteAccess            = 7,
  198.     cmBeginAccess                = 8,
  199.     cmEndAccess                    = 9
  200. };
  201.  
  202.  
  203. /* Abstract data type for memory-based Profile */
  204. typedef struct OpaqueCMProfileRef*         CMProfileRef;
  205. /* Abstract data type for Profile search result */
  206. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  207. /* Abstract data type for BeginMatching(…) reference */
  208. typedef struct OpaqueCMMatchRef*         CMMatchRef;
  209. /* Abstract data type for ColorWorld reference */
  210. typedef struct OpaqueCMWorldRef*         CMWorldRef;
  211. /* Caller-supplied flatten function */
  212. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  213. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  214. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  215. /* Caller-supplied filter function for Profile search */
  216. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  217. /* Caller-supplied function for profile access */
  218. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  219. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                         CMFlattenUPP;
  220. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  221. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                     CMProfileFilterUPP;
  222. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                     CMProfileAccessUPP;
  223. enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  224. enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  225. enum { uppCMProfileFilterProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  226. enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  227. #define NewCMFlattenProc(userRoutine)                             (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  228. #define NewCMBitmapCallBackProc(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  229. #define NewCMProfileFilterProc(userRoutine)                     (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  230. #define NewCMProfileAccessProc(userRoutine)                     (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  231. #define CallCMFlattenProc(userRoutine, command, size, data, refCon)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  232. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  233. #define CallCMProfileFilterProc(userRoutine, prof, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppCMProfileFilterProcInfo, (prof), (refCon))
  234. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon)  CALL_FIVE_PARAMETER_UPP((userRoutine), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  235. typedef long                             CMError;
  236. /* For 1.0 and 2.0 profile header variants */
  237. /* CMAppleProfileHeader */
  238. union CMAppleProfileHeader {
  239.     CMHeader                         cm1;
  240.     CM2Header                         cm2;
  241. };
  242. typedef union CMAppleProfileHeader CMAppleProfileHeader;
  243.  
  244. /* Param for CWConcatColorWorld(…) */
  245. struct CMConcatProfileSet {
  246.     unsigned short                     keyIndex;                    /* Zero-based */
  247.     unsigned short                     count;                        /* Min 1 */
  248.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  249. };
  250. typedef struct CMConcatProfileSet CMConcatProfileSet;
  251.  
  252. /* ColorSync color data types */
  253. struct CMRGBColor {
  254.     unsigned short                     red;                        /* 0..65535 */
  255.     unsigned short                     green;
  256.     unsigned short                     blue;
  257. };
  258. typedef struct CMRGBColor CMRGBColor;
  259.  
  260. struct CMCMYKColor {
  261.     unsigned short                     cyan;                        /* 0..65535 */
  262.     unsigned short                     magenta;
  263.     unsigned short                     yellow;
  264.     unsigned short                     black;
  265. };
  266. typedef struct CMCMYKColor CMCMYKColor;
  267.  
  268. struct CMCMYColor {
  269.     unsigned short                     cyan;                        /* 0..65535 */
  270.     unsigned short                     magenta;
  271.     unsigned short                     yellow;
  272. };
  273. typedef struct CMCMYColor CMCMYColor;
  274.  
  275. struct CMHLSColor {
  276.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  277.     unsigned short                     lightness;                    /* 0..65535 */
  278.     unsigned short                     saturation;                    /* 0..65535 */
  279. };
  280. typedef struct CMHLSColor CMHLSColor;
  281.  
  282. struct CMHSVColor {
  283.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  284.     unsigned short                     saturation;                    /* 0..65535 */
  285.     unsigned short                     value;                        /* 0..65535 */
  286. };
  287. typedef struct CMHSVColor CMHSVColor;
  288.  
  289. struct CMLabColor {
  290.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  291.     unsigned short                     a;                            /* 0..65535 maps to -128..127.996 */
  292.     unsigned short                     b;                            /* 0..65535 maps to -128..127.996 */
  293. };
  294. typedef struct CMLabColor CMLabColor;
  295.  
  296. struct CMLuvColor {
  297.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  298.     unsigned short                     u;                            /* 0..65535 maps to -128..127.996 */
  299.     unsigned short                     v;                            /* 0..65535 maps to -128..127.996 */
  300. };
  301. typedef struct CMLuvColor CMLuvColor;
  302.  
  303. struct CMYxyColor {
  304.     unsigned short                     capY;                        /* 0..65535 maps to 0..1 */
  305.     unsigned short                     x;                            /* 0..65535 maps to 0..1 */
  306.     unsigned short                     y;                            /* 0..65535 maps to 0..1 */
  307. };
  308. typedef struct CMYxyColor CMYxyColor;
  309.  
  310. struct CMGrayColor {
  311.     unsigned short                     gray;                        /* 0..65535 */
  312. };
  313. typedef struct CMGrayColor CMGrayColor;
  314.  
  315. struct CMMultichannel5Color {
  316.     unsigned char                     components[5];                /* 0..255 */
  317. };
  318. typedef struct CMMultichannel5Color CMMultichannel5Color;
  319.  
  320. struct CMMultichannel6Color {
  321.     unsigned char                     components[6];                /* 0..255 */
  322. };
  323. typedef struct CMMultichannel6Color CMMultichannel6Color;
  324.  
  325. struct CMMultichannel7Color {
  326.     unsigned char                     components[7];                /* 0..255 */
  327. };
  328. typedef struct CMMultichannel7Color CMMultichannel7Color;
  329.  
  330. struct CMMultichannel8Color {
  331.     unsigned char                     components[8];                /* 0..255 */
  332. };
  333. typedef struct CMMultichannel8Color CMMultichannel8Color;
  334.  
  335. struct CMNamedColor {
  336.     unsigned long                     namedColorIndex;            /* 0..a lot */
  337. };
  338. typedef struct CMNamedColor CMNamedColor;
  339.  
  340. union CMColor {
  341.     CMRGBColor                         rgb;
  342.     CMHSVColor                         hsv;
  343.     CMHLSColor                         hls;
  344.     CMXYZColor                         XYZ;
  345.     CMLabColor                         Lab;
  346.     CMLuvColor                         Luv;
  347.     CMYxyColor                         Yxy;
  348.     CMCMYKColor                     cmyk;
  349.     CMCMYColor                         cmy;
  350.     CMGrayColor                     gray;
  351.     CMMultichannel5Color             mc5;
  352.     CMMultichannel6Color             mc6;
  353.     CMMultichannel7Color             mc7;
  354.     CMMultichannel8Color             mc8;
  355.     CMNamedColor                     namedColor;
  356. };
  357. typedef union CMColor CMColor;
  358.  
  359. struct CMProfileSearchRecord {
  360.     CMHeader                         header;
  361.     unsigned long                     fieldMask;
  362.     unsigned long                     reserved[2];
  363. };
  364. typedef struct CMProfileSearchRecord CMProfileSearchRecord;
  365.  
  366. typedef CMProfileSearchRecord *            CMProfileSearchRecordPtr;
  367. typedef CMProfileSearchRecordPtr *        CMProfileSearchRecordHandle;
  368. /* Search definition for 2.0 */
  369. struct CMSearchRecord {
  370.     OSType                             CMMType;
  371.     OSType                             profileClass;
  372.     OSType                             dataColorSpace;
  373.     OSType                             profileConnectionSpace;
  374.     unsigned long                     deviceManufacturer;
  375.     unsigned long                     deviceModel;
  376.     unsigned long                     deviceAttributes[2];
  377.     unsigned long                     profileFlags;
  378.     unsigned long                     searchMask;
  379.     CMProfileFilterUPP                 filter;
  380. };
  381. typedef struct CMSearchRecord CMSearchRecord;
  382.  
  383. /* GetCWInfo structures */
  384. struct CMMInfoRecord {
  385.     OSType                             CMMType;
  386.     long                             CMMVersion;
  387. };
  388. typedef struct CMMInfoRecord CMMInfoRecord;
  389.  
  390. struct CMCWInfoRecord {
  391.     unsigned long                     cmmCount;
  392.     CMMInfoRecord                     cmmInfo[2];
  393. };
  394. typedef struct CMCWInfoRecord CMCWInfoRecord;
  395.  
  396. /* profile identifier structures */
  397. struct CMProfileIdentifier {
  398.     CM2Header                         profileHeader;
  399.     CMDateTime                         calibrationDate;
  400.     unsigned long                     ASCIIProfileDescriptionLen;
  401.     char                             ASCIIProfileDescription[1];    /* variable length */
  402. };
  403. typedef struct CMProfileIdentifier CMProfileIdentifier;
  404.  
  405. typedef CMProfileIdentifier *            CMProfileIdentifierPtr;
  406. /* packing formats */
  407.  
  408. enum {
  409.     cmNoColorPacking            = 0x0000,
  410.     cmAlphaSpace                = 0x0080,
  411.     cmWord5ColorPacking            = 0x0500,
  412.     cmLong8ColorPacking            = 0x0800,
  413.     cmLong10ColorPacking        = 0x0A00,
  414.     cmAlphaFirstPacking            = 0x1000,
  415.     cmOneBitDirectPacking        = 0x0B00,
  416.     cmAlphaLastPacking            = 0x0000,
  417.     cm24_8ColorPacking            = 0x2100,
  418.     cm32_8ColorPacking            = cmLong8ColorPacking,
  419.     cm40_8ColorPacking            = 0x2200,
  420.     cm48_8ColorPacking            = 0x2300,
  421.     cm56_8ColorPacking            = 0x2400,
  422.     cm64_8ColorPacking            = 0x2500,
  423.     cm32_16ColorPacking            = 0x2600,
  424.     cm32_32ColorPacking            = 0x2700
  425. };
  426.  
  427. /* general colorspaces */
  428.  
  429. enum {
  430.     cmNoSpace                    = 0,
  431.     cmRGBSpace                    = 1,
  432.     cmCMYKSpace                    = 2,
  433.     cmHSVSpace                    = 3,
  434.     cmHLSSpace                    = 4,
  435.     cmYXYSpace                    = 5,
  436.     cmXYZSpace                    = 6,
  437.     cmLUVSpace                    = 7,
  438.     cmLABSpace                    = 8,
  439.     cmReservedSpace1            = 9,
  440.     cmGraySpace                    = 10,
  441.     cmReservedSpace2            = 11,
  442.     cmGamutResultSpace            = 12,
  443.     cmNamedIndexedSpace            = 16,
  444.     cmMCFiveSpace                = 17,
  445.     cmMCSixSpace                = 18,
  446.     cmMCSevenSpace                = 19,
  447.     cmMCEightSpace                = 20
  448. };
  449.  
  450. /* supported CMBitmapColorSpaces - each of the following is a */
  451. /* combination of a general colospace and a packing formats */
  452.  
  453. enum {
  454.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  455.     cmGrayASpace                = cmGraySpace + cmAlphaSpace,
  456.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace,
  457.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace,
  458.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace,
  459.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace,
  460.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace,
  461.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace,
  462.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace,
  463.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace,
  464.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace,
  465.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace,
  466.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  467.     cmRGB24Space                = cm24_8ColorPacking + cmRGBSpace,
  468.     cmRGBA32Space                = cm32_8ColorPacking + cmAlphaLastPacking + cmRGBASpace,
  469.     cmLAB24Space                = cm24_8ColorPacking + cmLABSpace,
  470.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  471.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  472.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  473.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  474.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  475. };
  476.  
  477.  
  478. typedef unsigned long                     CMBitmapColorSpace;
  479. struct CMBitmap {
  480.     char *                            image;
  481.     long                             width;
  482.     long                             height;
  483.     long                             rowBytes;
  484.     long                             pixelSize;
  485.     CMBitmapColorSpace                 space;
  486.     long                             user1;
  487.     long                             user2;
  488. };
  489. typedef struct CMBitmap CMBitmap;
  490.  
  491.  
  492. /* Classic Print Manager Stuff */
  493.  
  494. enum {
  495.     enableColorMatchingOp        = 12,
  496.     registerProfileOp            = 13
  497. };
  498.  
  499.  
  500. enum {
  501.     cmNoProfileBase                = 0,
  502.     cmFileBasedProfile            = 1,
  503.     cmHandleBasedProfile        = 2,
  504.     cmPtrBasedProfile            = 3,
  505.     cmProcedureBasedProfile        = 4
  506. };
  507.  
  508. struct CMFileLocation {
  509.     FSSpec                             spec;
  510. };
  511. typedef struct CMFileLocation CMFileLocation;
  512.  
  513. struct CMHandleLocation {
  514.     Handle                             h;
  515. };
  516. typedef struct CMHandleLocation CMHandleLocation;
  517.  
  518. struct CMPtrLocation {
  519.     Ptr                             p;
  520. };
  521. typedef struct CMPtrLocation CMPtrLocation;
  522.  
  523. struct CMProcedureLocation {
  524.     CMProfileAccessUPP                 proc;
  525.     void *                            refCon;
  526. };
  527. typedef struct CMProcedureLocation CMProcedureLocation;
  528.  
  529.  
  530. union CMProfLoc {
  531.     CMFileLocation                     fileLoc;
  532.     CMHandleLocation                 handleLoc;
  533.     CMPtrLocation                     ptrLoc;
  534.     CMProcedureLocation             procLoc;
  535. };
  536. typedef union CMProfLoc CMProfLoc;
  537.  
  538. struct CMProfileLocation {
  539.     short                             locType;
  540.     CMProfLoc                         u;
  541. };
  542. typedef struct CMProfileLocation CMProfileLocation;
  543.  
  544. /* Profile file and element access */
  545. EXTERN_API( CMError )
  546. CMNewProfile                    (CMProfileRef *            prof,
  547.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  548.  
  549. EXTERN_API( CMError )
  550. CMOpenProfile                    (CMProfileRef *            prof,
  551.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  552.  
  553. EXTERN_API( CMError )
  554. CMCloseProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  555.  
  556. EXTERN_API( CMError )
  557. CMUpdateProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  558.  
  559. EXTERN_API( CMError )
  560. CMCopyProfile                    (CMProfileRef *            targetProf,
  561.                                  const CMProfileLocation * targetLocation,
  562.                                  CMProfileRef             srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  563.  
  564. EXTERN_API( CMError )
  565. CMValidateProfile                (CMProfileRef             prof,
  566.                                  Boolean *                valid,
  567.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  568.  
  569. EXTERN_API( CMError )
  570. CMGetProfileLocation            (CMProfileRef             prof,
  571.                                  CMProfileLocation *    theProfile)                            FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  572.  
  573. EXTERN_API( CMError )
  574. CMFlattenProfile                (CMProfileRef             prof,
  575.                                  unsigned long             flags,
  576.                                  CMFlattenUPP             proc,
  577.                                  void *                    refCon,
  578.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  579.  
  580. EXTERN_API( CMError )
  581. CMUnflattenProfile                (FSSpec *                resultFileSpec,
  582.                                  CMFlattenUPP             proc,
  583.                                  void *                    refCon,
  584.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  585.  
  586. EXTERN_API( CMError )
  587. CMGetProfileHeader                (CMProfileRef             prof,
  588.                                  CMAppleProfileHeader *    header)                                FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  589.  
  590. EXTERN_API( CMError )
  591. CMSetProfileHeader                (CMProfileRef             prof,
  592.                                  const CMAppleProfileHeader * header)                        FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  593.  
  594. EXTERN_API( CMError )
  595. CMProfileElementExists            (CMProfileRef             prof,
  596.                                  OSType                 tag,
  597.                                  Boolean *                found)                                FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  598.  
  599. EXTERN_API( CMError )
  600. CMCountProfileElements            (CMProfileRef             prof,
  601.                                  unsigned long *        elementCount)                        FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  602.  
  603. EXTERN_API( CMError )
  604. CMGetProfileElement                (CMProfileRef             prof,
  605.                                  OSType                 tag,
  606.                                  unsigned long *        elementSize,
  607.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  608.  
  609. EXTERN_API( CMError )
  610. CMSetProfileElement                (CMProfileRef             prof,
  611.                                  OSType                 tag,
  612.                                  unsigned long             elementSize,
  613.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  614.  
  615. EXTERN_API( CMError )
  616. CMSetProfileElementSize            (CMProfileRef             prof,
  617.                                  OSType                 tag,
  618.                                  unsigned long             elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  619.  
  620. EXTERN_API( CMError )
  621. CMSetProfileElementReference    (CMProfileRef             prof,
  622.                                  OSType                 elementTag,
  623.                                  OSType                 referenceTag)                        FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  624.  
  625. EXTERN_API( CMError )
  626. CMGetPartialProfileElement        (CMProfileRef             prof,
  627.                                  OSType                 tag,
  628.                                  unsigned long             offset,
  629.                                  unsigned long *        byteCount,
  630.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  631.  
  632. EXTERN_API( CMError )
  633. CMSetPartialProfileElement        (CMProfileRef             prof,
  634.                                  OSType                 tag,
  635.                                  unsigned long             offset,
  636.                                  unsigned long             byteCount,
  637.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  638.  
  639. EXTERN_API( CMError )
  640. CMGetIndProfileElementInfo        (CMProfileRef             prof,
  641.                                  unsigned long             index,
  642.                                  OSType *                tag,
  643.                                  unsigned long *        elementSize,
  644.                                  Boolean *                refs)                                FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  645.  
  646. EXTERN_API( CMError )
  647. CMGetIndProfileElement            (CMProfileRef             prof,
  648.                                  unsigned long             index,
  649.                                  unsigned long *        elementSize,
  650.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  651.  
  652. EXTERN_API( CMError )
  653. CMRemoveProfileElement            (CMProfileRef             prof,
  654.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  655.  
  656. EXTERN_API( CMError )
  657. CMGetScriptProfileDescription    (CMProfileRef             prof,
  658.                                  Str255                 name,
  659.                                  ScriptCode *            code)                                FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  660.  
  661. EXTERN_API( CMError )
  662. CMCloneProfileRef                (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  663.  
  664. EXTERN_API( CMError )
  665. CMGetProfileRefCount            (CMProfileRef             prof,
  666.                                  long *                    count)                                FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  667.  
  668. EXTERN_API( CMError )
  669. CMProfileModified                (CMProfileRef             prof,
  670.                                  Boolean *                modified)                            FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  671.  
  672.  
  673. /* named Color access functions */
  674. EXTERN_API( CMError )
  675. CMGetNamedColorInfo                (CMProfileRef             prof,
  676.                                  unsigned long *        deviceChannels,
  677.                                  OSType *                deviceColorSpace,
  678.                                  OSType *                PCSColorSpace,
  679.                                  unsigned long *        count,
  680.                                  StringPtr                 prefix,
  681.                                  StringPtr                 suffix)                                FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  682.  
  683. EXTERN_API( CMError )
  684. CMGetNamedColorValue            (CMProfileRef             prof,
  685.                                  StringPtr                 name,
  686.                                  CMColor *                deviceColor,
  687.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  688.  
  689. EXTERN_API( CMError )
  690. CMGetIndNamedColorValue            (CMProfileRef             prof,
  691.                                  unsigned long             index,
  692.                                  CMColor *                deviceColor,
  693.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  694.  
  695. EXTERN_API( CMError )
  696. CMGetNamedColorIndex            (CMProfileRef             prof,
  697.                                  StringPtr                 name,
  698.                                  unsigned long *        index)                                FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  699.  
  700. EXTERN_API( CMError )
  701. CMGetNamedColorName                (CMProfileRef             prof,
  702.                                  unsigned long             index,
  703.                                  StringPtr                 name)                                FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  704.  
  705.  
  706. /* Low-level matching functions */
  707. EXTERN_API( CMError )
  708. NCWNewColorWorld                (CMWorldRef *            cw,
  709.                                  CMProfileRef             src,
  710.                                  CMProfileRef             dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  711.  
  712. EXTERN_API( CMError )
  713. CWConcatColorWorld                (CMWorldRef *            cw,
  714.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  715.  
  716. EXTERN_API( CMError )
  717. CWNewLinkProfile                (CMProfileRef *            prof,
  718.                                  const CMProfileLocation * targetLocation,
  719.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  720.  
  721. EXTERN_API( void )
  722. CWDisposeColorWorld                (CMWorldRef             cw)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  723.  
  724. EXTERN_API( CMError )
  725. CWMatchColors                    (CMWorldRef             cw,
  726.                                  CMColor *                myColors,
  727.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  728.  
  729. EXTERN_API( CMError )
  730. CWCheckColors                    (CMWorldRef             cw,
  731.                                  CMColor *                myColors,
  732.                                  unsigned long             count,
  733.                                  long *                    result)                                FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  734.  
  735.  
  736. /* Bitmap matching */
  737. EXTERN_API( CMError )
  738. CWMatchBitmap                    (CMWorldRef             cw,
  739.                                  CMBitmap *                bitmap,
  740.                                  CMBitmapCallBackUPP     progressProc,
  741.                                  void *                    refCon,
  742.                                  CMBitmap *                matchedBitmap)                        FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  743.  
  744. EXTERN_API( CMError )
  745. CWCheckBitmap                    (CMWorldRef             cw,
  746.                                  const CMBitmap *        bitmap,
  747.                                  CMBitmapCallBackUPP     progressProc,
  748.                                  void *                    refCon,
  749.                                  CMBitmap *                resultBitmap)                        FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  750.  
  751.  
  752. /* Quickdraw-specific matching */
  753. EXTERN_API( CMError )
  754. CWMatchPixMap                    (CMWorldRef             cw,
  755.                                  PixMap *                myPixMap,
  756.                                  CMBitmapCallBackUPP     progressProc,
  757.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  758.  
  759. EXTERN_API( CMError )
  760. CWCheckPixMap                    (CMWorldRef             cw,
  761.                                  PixMap *                myPixMap,
  762.                                  CMBitmapCallBackUPP     progressProc,
  763.                                  void *                    refCon,
  764.                                  BitMap *                resultBitMap)                        FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  765.  
  766. EXTERN_API( CMError )
  767. NCMBeginMatching                (CMProfileRef             src,
  768.                                  CMProfileRef             dst,
  769.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  770.  
  771. EXTERN_API( void )
  772. CMEndMatching                    (CMMatchRef             myRef)                                FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  773.  
  774. EXTERN_API( void )
  775. NCMDrawMatchedPicture            (PicHandle                 myPicture,
  776.                                  CMProfileRef             dst,
  777.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  778.  
  779. EXTERN_API( void )
  780. CMEnableMatchingComment            (Boolean                 enableIt)                            FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  781.  
  782. EXTERN_API( CMError )
  783. NCMUseProfileComment            (CMProfileRef             prof,
  784.                                  unsigned long             flags)                                FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  785.  
  786. EXTERN_API( CMError )
  787. CMCreateProfileIdentifier        (CMProfileRef             prof,
  788.                                  CMProfileIdentifierPtr  ident,
  789.                                  unsigned long *        size)                                FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  790.  
  791.  
  792. /* System Profile access */
  793. EXTERN_API( CMError )
  794. CMGetSystemProfile                (CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  795.  
  796. EXTERN_API( CMError )
  797. CMSetSystemProfile                (const FSSpec *            profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  798.  
  799.  
  800. /* External Profile Management */
  801. EXTERN_API( CMError )
  802. CMNewProfileSearch                (CMSearchRecord *        searchSpec,
  803.                                  void *                    refCon,
  804.                                  unsigned long *        count,
  805.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  806.  
  807. EXTERN_API( CMError )
  808. CMUpdateProfileSearch            (CMProfileSearchRef     search,
  809.                                  void *                    refCon,
  810.                                  unsigned long *        count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  811.  
  812. EXTERN_API( void )
  813. CMDisposeProfileSearch            (CMProfileSearchRef     search)                                FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  814.  
  815. EXTERN_API( CMError )
  816. CMSearchGetIndProfile            (CMProfileSearchRef     search,
  817.                                  unsigned long             index,
  818.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  819.  
  820. EXTERN_API( CMError )
  821. CMSearchGetIndProfileFileSpec    (CMProfileSearchRef     search,
  822.                                  unsigned long             index,
  823.                                  FSSpec *                profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  824.  
  825. EXTERN_API( CMError )
  826. CMProfileIdentifierFolderSearch    (CMProfileIdentifierPtr  ident,
  827.                                  unsigned long *        matchedCount,
  828.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  829.  
  830. EXTERN_API( CMError )
  831. CMProfileIdentifierListSearch    (CMProfileIdentifierPtr  ident,
  832.                                  CMProfileRef *            profileList,
  833.                                  unsigned long             listSize,
  834.                                  unsigned long *        matchedCount,
  835.                                  CMProfileRef *            matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  836.  
  837.  
  838. /* Utilities */
  839. EXTERN_API( CMError )
  840. CMGetColorSyncFolderSpec        (short                     vRefNum,
  841.                                  Boolean                 createFolder,
  842.                                  short *                foundVRefNum,
  843.                                  long *                    foundDirID)                            FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  844.  
  845. EXTERN_API( CMError )
  846. CMGetCWInfo                        (CMWorldRef             cw,
  847.                                  CMCWInfoRecord *        info)                                FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  848.  
  849. EXTERN_API( CMError )
  850. CMConvertProfile2to1            (CMProfileRef             profv2,
  851.                                  CMProfileHandle *        profv1)                                FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  852.  
  853. /* ColorSpace conversion functions */
  854. EXTERN_API( CMError )
  855. CMConvertXYZToLab                (const CMColor *        src,
  856.                                  const CMXYZColor *        white,
  857.                                  CMColor *                dst,
  858.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  859.  
  860. EXTERN_API( CMError )
  861. CMConvertLabToXYZ                (const CMColor *        src,
  862.                                  const CMXYZColor *        white,
  863.                                  CMColor *                dst,
  864.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  865.  
  866. EXTERN_API( CMError )
  867. CMConvertXYZToLuv                (const CMColor *        src,
  868.                                  const CMXYZColor *        white,
  869.                                  CMColor *                dst,
  870.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  871.  
  872. EXTERN_API( CMError )
  873. CMConvertLuvToXYZ                (const CMColor *        src,
  874.                                  const CMXYZColor *        white,
  875.                                  CMColor *                dst,
  876.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  877.  
  878. EXTERN_API( CMError )
  879. CMConvertXYZToYxy                (const CMColor *        src,
  880.                                  CMColor *                dst,
  881.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  882.  
  883. EXTERN_API( CMError )
  884. CMConvertYxyToXYZ                (const CMColor *        src,
  885.                                  CMColor *                dst,
  886.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  887.  
  888. EXTERN_API( CMError )
  889. CMConvertRGBToHLS                (const CMColor *        src,
  890.                                  CMColor *                dst,
  891.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  892.  
  893. EXTERN_API( CMError )
  894. CMConvertHLSToRGB                (const CMColor *        src,
  895.                                  CMColor *                dst,
  896.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  897.  
  898. EXTERN_API( CMError )
  899. CMConvertRGBToHSV                (const CMColor *        src,
  900.                                  CMColor *                dst,
  901.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  902.  
  903. EXTERN_API( CMError )
  904. CMConvertHSVToRGB                (const CMColor *        src,
  905.                                  CMColor *                dst,
  906.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  907.  
  908. EXTERN_API( CMError )
  909. CMConvertRGBToGray                (const CMColor *        src,
  910.                                  CMColor *                dst,
  911.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  912.  
  913. EXTERN_API( CMError )
  914. CMConvertXYZToFixedXYZ            (const CMXYZColor *        src,
  915.                                  CMFixedXYZColor *        dst,
  916.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  917.  
  918. EXTERN_API( CMError )
  919. CMConvertFixedXYZToXYZ            (const CMFixedXYZColor * src,
  920.                                  CMXYZColor *            dst,
  921.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  922.  
  923. /* PS-related */
  924. EXTERN_API( CMError )
  925. CMGetPS2ColorSpace                (CMProfileRef             srcProf,
  926.                                  unsigned long             flags,
  927.                                  CMFlattenUPP             proc,
  928.                                  void *                    refCon,
  929.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  930.  
  931. EXTERN_API( CMError )
  932. CMGetPS2ColorRenderingIntent    (CMProfileRef             srcProf,
  933.                                  unsigned long             flags,
  934.                                  CMFlattenUPP             proc,
  935.                                  void *                    refCon,
  936.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  937.  
  938. EXTERN_API( CMError )
  939. CMGetPS2ColorRendering            (CMProfileRef             srcProf,
  940.                                  CMProfileRef             dstProf,
  941.                                  unsigned long             flags,
  942.                                  CMFlattenUPP             proc,
  943.                                  void *                    refCon,
  944.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  945.  
  946. EXTERN_API( CMError )
  947. CMGetPS2ColorRenderingVMSize    (CMProfileRef             srcProf,
  948.                                  CMProfileRef             dstProf,
  949.                                  unsigned long *        vmSize,
  950.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  951.  
  952.  
  953. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  954. EXTERN_API( CMError )
  955. CWNewColorWorld                    (CMWorldRef *            cw,
  956.                                  CMProfileHandle         src,
  957.                                  CMProfileHandle         dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  958.  
  959. EXTERN_API( CMError )
  960. ConcatenateProfiles                (CMProfileHandle         thru,
  961.                                  CMProfileHandle         dst,
  962.                                  CMProfileHandle *        newDst)                                FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  963.  
  964. EXTERN_API( CMError )
  965. CMBeginMatching                    (CMProfileHandle         src,
  966.                                  CMProfileHandle         dst,
  967.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  968.  
  969. EXTERN_API( void )
  970. CMDrawMatchedPicture            (PicHandle                 myPicture,
  971.                                  CMProfileHandle         dst,
  972.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  973.  
  974. EXTERN_API( CMError )
  975. CMUseProfileComment                (CMProfileHandle         profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  976.  
  977. EXTERN_API( void )
  978. CMGetProfileName                (CMProfileHandle         myProfile,
  979.                                  CMIString *            IStringResult)                        FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  980.  
  981. EXTERN_API( long )
  982. CMGetProfileAdditionalDataOffset (CMProfileHandle         myProfile)                            FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  983.  
  984.  
  985. /* ProfileResponder functions */
  986. EXTERN_API( CMError )
  987. GetProfile                        (OSType                 deviceType,
  988.                                  long                     refNum,
  989.                                  CMProfileHandle         aProfile,
  990.                                  CMProfileHandle *        returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  991.  
  992. EXTERN_API( CMError )
  993. SetProfile                        (OSType                 deviceType,
  994.                                  long                     refNum,
  995.                                  CMProfileHandle         newProfile)                            FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  996.  
  997. EXTERN_API( CMError )
  998. SetProfileDescription            (OSType                 deviceType,
  999.                                  long                     refNum,
  1000.                                  long                     deviceData,
  1001.                                  CMProfileHandle         hProfile)                            FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1002.  
  1003. EXTERN_API( CMError )
  1004. GetIndexedProfile                (OSType                 deviceType,
  1005.                                  long                     refNum,
  1006.                                  CMProfileSearchRecordHandle  search,
  1007.                                  CMProfileHandle *        returnProfile,
  1008.                                  long *                    index)                                FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1009.  
  1010. EXTERN_API( CMError )
  1011. DeleteDeviceProfile                (OSType                 deviceType,
  1012.                                  long                     refNum,
  1013.                                  CMProfileHandle         deleteMe)                            FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1014.  
  1015.  
  1016. #if OLDROUTINENAMES
  1017. /* constants */
  1018. typedef CMFlattenProcPtr                 CMFlattenProc;
  1019. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1020. typedef CMProfileFilterProcPtr             CMProfileFilterProc;
  1021.  
  1022. enum {
  1023.     CMTrap                        = cmTrap,
  1024.     CMBeginProfile                = cmBeginProfile,
  1025.     CMEndProfile                = cmEndProfile,
  1026.     CMEnableMatching            = cmEnableMatching,
  1027.     CMDisableMatching            = cmDisableMatching
  1028. };
  1029.  
  1030. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1031.  
  1032. enum {
  1033.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  1034.     CMProfileError                = cmProfileError,
  1035.     CMMethodError                = cmMethodError,
  1036.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  1037.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  1038.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  1039.     CMMethodNotFound            = cmMethodNotFound,
  1040.     CMProfileNotFound            = cmProfileNotFound,
  1041.     CMProfilesIdentical            = cmProfilesIdentical,
  1042.     CMCantConcatenateError        = cmCantConcatenateError,
  1043.     CMCantXYZ                    = cmCantXYZ,
  1044.     CMCantDeleteProfile            = cmCantDeleteProfile,
  1045.     CMUnsupportedDataType        = cmUnsupportedDataType,
  1046.     CMNoCurrentProfile            = cmNoCurrentProfile
  1047. };
  1048.  
  1049.  
  1050. enum {
  1051.     qdSystemDevice                = cmSystemDevice,
  1052.     qdGDevice                    = cmGDevice
  1053. };
  1054.  
  1055.  
  1056. enum {
  1057.     kMatchCMMType                = cmMatchCMMType,
  1058.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1059.     kMatchDataType                = cmMatchDataType,
  1060.     kMatchDeviceType            = cmMatchDeviceType,
  1061.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1062.     kMatchDeviceModel            = cmMatchDeviceModel,
  1063.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  1064.     kMatchFlags                    = cmMatchFlags,
  1065.     kMatchOptions                = cmMatchOptions,
  1066.     kMatchWhite                    = cmMatchWhite,
  1067.     kMatchBlack                    = cmMatchBlack
  1068. };
  1069.  
  1070. /* types */
  1071. typedef CMCMYKColor                     CMYKColor;
  1072. typedef CMWorldRef                         CWorld;
  1073. typedef long *                            CMGamutResult;
  1074. /* functions */
  1075. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  1076. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1077. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1078. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  1079. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  1080. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  1081. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1082. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  1083. #endif  /* OLDROUTINENAMES */
  1084.  
  1085.  
  1086. /* Deprecated stuff*/
  1087.  
  1088. /* PrGeneral parameter blocks */
  1089. struct TEnableColorMatchingBlk {
  1090.     short                             iOpCode;
  1091.     short                             iError;
  1092.     long                             lReserved;
  1093.     THPrint                         hPrint;
  1094.     Boolean                         fEnableIt;
  1095.     SInt8                             filler;
  1096. };
  1097. typedef struct TEnableColorMatchingBlk TEnableColorMatchingBlk;
  1098.  
  1099. struct TRegisterProfileBlk {
  1100.     short                             iOpCode;
  1101.     short                             iError;
  1102.     long                             lReserved;
  1103.     THPrint                         hPrint;
  1104.     Boolean                         fRegisterIt;
  1105.     SInt8                             filler;
  1106. };
  1107. typedef struct TRegisterProfileBlk TRegisterProfileBlk;
  1108.  
  1109.  
  1110. #if PRAGMA_STRUCT_ALIGN
  1111.     #pragma options align=reset
  1112. #elif PRAGMA_STRUCT_PACKPUSH
  1113.     #pragma pack(pop)
  1114. #elif PRAGMA_STRUCT_PACK
  1115.     #pragma pack()
  1116. #endif
  1117.  
  1118. #ifdef PRAGMA_IMPORT_OFF
  1119. #pragma import off
  1120. #elif PRAGMA_IMPORT
  1121. #pragma import reset
  1122. #endif
  1123.  
  1124. #ifdef __cplusplus
  1125. }
  1126. #endif
  1127.  
  1128. #endif /* __CMAPPLICATION__ */
  1129.  
  1130.